package com.dgut;

import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.core.env.Environment;

@EnableConfigurationProperties(MyProperties.class)
public class MyAutoConfig{
    @Bean
    @ConditionalOnProperty(prefix="tll.auto", name="enable", havingValue="true")
    public CommandLineRunner getMyCommandLineRunner(Environment env){
        return new MyCommandLineRunner(env);
    }
}
